-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(xtask): 'changes' xtask #12089
feat(xtask): 'changes' xtask #12089
Conversation
This will report what commits affect each publishable package and serves as an alternative to rust-lang#12085. CI can run this as `cargo changes HEAD~ HEAD^2` and that will capture all of the commits within the PR (this is the range I used in `committed`). There is still work needed to integrate this with an action; this is just a rough base-line implementation. I originally tried to use `cargo package --list` to determine what files belong to what packages but that was taking too long for some reason (it works well in `cargo release` for my crates). We can either look into that in the future or do our own heuristics to filter out content.
r? @ehuss (rustbot has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fast prototyping. This looks pretty complete to me!
Some thoughts:
- The cargo project doesn't adopt git conventional commit message pattern. Not sure if it is worthy or we should enforce that.
- Perhaps switch to
gix
if we plan to dropgit2
someday. - If we merge this or else, should we remove
xtask-unpublished
? - The code is indeed in a high quality. I can't be pickier at code level. However, total lines of code usually correlate to maintenance cost. I am a bit worried it's a bit overkill when comparing to what can be done in shell scripts.
- This is a good demonstration of how people can invent something interesting with
cargo
and other libraries. I love the pretty status output!
I copied that over from
Yeah, I stuck with what I was used to / what there are existing resources for. Digging into
Unsure, in part because these are experiments but in part because I don't fully remember what all building blocks I originally intended...
Shell scripts are also deceptively short and error prone :) I also went past the absolute minimum (e.g. defaulting At the moment, this is also written in a way that I could see it being useful for writing up changelogs, so we might be able to get more mileage out of it.
And it is another way for us to dogfood to identify problems, like the fact that I can't make a call to say "tell me what files will be included in a package" but have to shell out for it (except I dropped it due to performance issues I hadn't debugged yet). This also reminds me that I hope to simplify some of this code in the future. For clap, I created |
☔ The latest upstream changes (presumably #12096) made this pull request unmergeable. Please resolve the merge conflicts. |
This made me wonder we would like to change each PR title before
My fault. I should ask your original intent first for To be clear, I see the values in these conventions and the command. However, it feels like going too far away from #12033. I was hoping there could be a way to catch not-yet-bumped versions in CI ASAP, so that we can start splitting internal building blocks into subcrates. |
r? weihanglo I think Weihang is following this more closely than I am. I haven't really reviewed this in detail, but the general concept seems good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine for listing changes. However, I still don't know how it works with requiring user to do a version bump. Did it really give user the information that they need bumping a version for a crate?
paths: std::collections::BTreeSet<std::path::PathBuf>, | ||
} | ||
|
||
impl CommitDescription { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would probably suggest to remove conventional commit part. Let's focus on the original goal for now.
.arg(clap::Arg::new("base-sha").help("SHA to diff against")) | ||
.arg(clap::Arg::new("head-sha").help("SHA with changes")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you consider copying part of #12126 for CI integration?
[Not a blocker] I still lean toward merging a similar approach like #12126 as a immediate guard rail. We can then properly design and expand this automation, thinking more on what we want for contributors and CI. |
ci: check if any version bump needed for member crates ### What does this PR try to resolve? Check if a crate requires a version bump in CI. Part of #12033 ### How should we test and review this PR? Demo action result: <https://github.com/weihanglo/cargo/actions/runs/4941952784/jobs/8835049007> ### Additional information This doesn't devalue #12089. I love the changelog detection, saving maintainers' times a lot ( I am the one writing changelogs for each release for now). However, the amount of code there is too excessive to me. I think someday when we are going to integrate [cargo-release](https://crates.io/crates/cargo-release) and/or [ehuss/cargo-new-release](https://github.com/ehuss/cargo-new-release), we can remove this script perhaps entirely :) I tried to document the script a bit hard. Hope it won't get worse over time.
Based on the direction of #12395, I think we can close this. What information we can learn from here has been called out in that other PR. |
This will report what commits affect each publishable package and serves as an alternative to #12085.
CI can run this as
cargo changes HEAD~ HEAD^2
and that will capture all of the commits within the PR (this is the range I used incommitted
).There is still work needed to integrate this with an action; this is just a rough base-line implementation.
I originally tried to use
cargo package --list
to determine what files belong to what packages but that was taking too long for some reason (it works well incargo release
for my crates). We can either look into that in the future or do our own heuristics to filter out content.